QuickTime 3 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Spin Tweener Component

A component of type kTweenTypeSpin returns a MatrixRecord that can be applied to a sprite or a track. The matrix returned causes a rotation based on a given number of rotations over the duration of the tween. The data for the tweener consists of an array of two Fixed numbers. The first Fixed number is the intialRotation value, specified as a fraction of one rotation. A number between 0 and 1 is expected; for instance, a value of 0.25 represents a rotation of 90 degrees. The second Fixed number is the number of rotations that should occur over the durationof the tween. For instance, to spin a sprite four and a half times this number should be 4.5.

The rotation is performed about an object's origin, which is usually 0.0. For a sprite, its origin is defined by its registration point; hence a spinning sprite will spin about its registration point. For more information about sprites, see Programming with QuickTime Sprites.

The spin tweener container description is the following:

[SpinTweenEntryAtoms)] =
    kTweenType, 1, 1
        [kTweenTypeSpin]

    kTweenData, 1, 1
        Fixed[2]

<kTweenStartOffset>, 1, 1
[TimeValue] = starting offset
            
<kTweenDuration>, 1, 1
[TimeValue] = duration
            
<kTweenSequenceElement>, (anyUniqueIDs), (1..numElementsInSequence)
[TweenSequenceEntryRecord]
            
<kTweenInterpolationID>, (a kTweenData ID), (1.. numInterpolationIDAtoms)
[QTAtomID] = the id of a kTweenEntry (child of [(TweenContainerFormat)]
describing the tween to be used to interpolate time values.

© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |